//ON.1 路由模块加载
import VueRouter from 'vue-router';


//ON.3 导入Vue核心语法
import Vue from 'vue'//核心语法模块

//ON.2 为vue添加扩展插件,但前置需要引入vue核心语法。
Vue.use(VueRouter);//为Vue添加扩展或插件
import homePage from "./views/homePage"
import filmDetailPage from "./views/filmDetailPage"
import filmsPage from "./views/filmsPage"
import foun404 from './components/foun404.vue'
const opt = {
    mode:'history',
    routes:[
    
        {path:'*',component:foun404},
        {path:'/',redirect:'/home'},
        {path:'/home',component:homePage},
        {path:'/films',component:filmsPage},
        {path:'/detail',component:filmDetailPage}
    ]
}
//ON.4 构建当前项目的独立路由
const router = new VueRouter(opt);
//ON.5 导出路由
export default router;